import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询设备列表
export function getDeviceList(data, query) {
  return request({
    url: '/monitor/monitorServer/list',
    method: 'post',
    params: query,
    data: data,
    isEncrypt: false
  })
}

// 查询设备详情
export function getDeviceInfo(id) {
  return request({
    url: '/monitor/monitorServer/info?id=' + id,
    method: 'get',
  })
}

// 新增设备
export function createDevice(data) {
  return request({
    url: '/monitor/monitorServer/add',
    method: 'post',
    data: data,
    isEncrypt: false
  })
}

// 修改设备
export function editDevice(data) {
  return request({
    url: '/monitor/monitorServer/edit',
    method: 'post',
    data: data,
    isEncrypt: false
  })
}

// 删除设备
export function deleteDevice(monitorserverId) {
  return request({
    url: '/monitor/monitorServer/remove?ids=' + monitorserverId,
    method: 'post',
    isEncrypt: false
  })
}

// 查询通道列表
export function getPassageList(data, query) {
  return request({
    url: '/monitor/monitorChannels/list',
    method: 'post',
    params: query,
    data: data,
    isEncrypt: false
  })
}

// 查询通道详情
export function getPassageInfo(id) {
  return request({
    url: '/monitor/monitorChannels/info?id=' + id,
    method: 'get',
  })
}

// 新增通道
export function createPassage(data) {
  return request({
    url: '/monitor/monitorChannels/add',
    method: 'post',
    data: data,
    isEncrypt: false
  })
}

// 修改通道
export function editPassage(data) {
  return request({
    url: '/monitor/monitorChannels/edit',
    method: 'post',
    data: data,
    isEncrypt: false
  })
}

// 删除通道
export function deletePassage(monitorchannelsId) {
  return request({
    url: '/monitor/monitorChannels/remove?ids=' + monitorchannelsId,
    method: 'post',
    isEncrypt: false
  })
}


// 获取应用类别房间树列表
export function getroomTypeTree(data) {
  return request({
    url: '/monitor/monitorApplication/roomTypeTree',
    method: 'post',
    data: data,
    isEncrypt: false
  })
}

//获取应用类别设备树列表
export function getdeviceChannelTree(data) {
  return request({
    url: '/monitor/monitorApplication/deviceChannelTree?unitId=' + data,
    method: 'post',
    isEncrypt: false
  })
}


//获取单位监控节点树
export function getunitDeviceChannelTree(data) {
  return request({
    url: '/monitor/monitorApplication/unitDeviceChannelTree?unitId=' + data,
    method: 'post',
    isEncrypt: false
  })
}

//获取单位监控节点树分类/monitor/monitorApplication/unitDeviceChannelTreeType
export function getunitDeviceChannelTreeType(data) {
  return request({
    url: '/monitor/monitorApplication/unitDeviceChannelTreeType',
    method: 'post',
    data:data,
    isEncrypt: false
  })
}

// 新增设备应用
export function createApplication(data) {
  return request({
    url: '/monitor/monitorApplication/add',
    method: 'post',
    data: data,
    isEncrypt: false
  })
}

// 查询设备应用列表
export function getApplicationList(data, query) {
  return request({
    url: '/monitor/monitorApplication/list',
    method: 'post',
    params: query,
    data: data,
    isEncrypt: false
  })
}

